
<div class="widget_wrap">
    <?php //debug($this->request->data)?>
    <div class="widget_top">
        <span class="h_icon blocks_images"></span>
        <h6>Edicion de rangos item # <?php echo $this->request->data['Laboratoriosrango']['id'] ?></h6>
    </div>
    <div class="widget_content">
        <?php echo $this->Form->create('Laboratorio', array('action' => 'ajaxeditarrango', 'id' => 'formregistrosintoma', 'class' => 'form_container left_label')); ?>
        <?php echo $this->Form->hidden('Laboratoriosrango.id', array('value' => $this->request->data['Laboratoriosrango']['id'])) ?>
        <?php echo $this->Form->hidden('Laboratoriosrango.laboratorio_id', array('value' => $id)) ?>
        <ul>
            <li>
                <div class="form_grid_12">
                    <label class="field_title" for="password">RangoInicial <span class="req">*</span></label>
                    <div class="form_input">
                         <?php echo $this->Form->text('Laboratoriosrango.rangoinicial', array('tabindex' => 1, 'class' => 'required mid')); ?>
                    </div>
                </div>
             </li>             
            <li>
                <div class="form_grid_12">
                    <label class="field_title" for="password">RangoFinal <span class="req">*</span></label>
                    <div class="form_input">
                         <?php echo $this->Form->text('Laboratoriosrango.rangofinal', array('tabindex' => 1, 'class' => 'required mid')); ?>
                    </div>
                </div>
             </li>
             <li>
                            <div class="form_grid_12">
                                <label class="field_title" for="password">Tipo de Rango<span class="req">(Solo para rangos variables)</span></label>
                                <div class="form_input"> 
                                    <select name="data[Laboratoriosrango][rango]">
                                    <?php $variable =  array(
                                        
                                            '0'=>array(
                                                'id'=>'',
                                        'nombre'=>'Ninguno'
                                            ),
                                            '1'=>array(
                                                'id'=>'0',
                                                'nombre'=>'Fuera'
                                            ),
                                            '2'=>array(
                                                'id'=>'1',
                                                'nombre'=>'Dentro'
                                            )
                                            
                                        )?>
                                    <?php foreach($variable as $v):?>
                                    <?php if($this->request->data['Laboratoriosrango']['rango'] == $v['id']):?>
                                        <option value="<?php echo $v['id']?>" selected="selected">
                                            <?php echo $v['nombre']?>
                                        </option>
                                    <?php else:?>
                                        <option value="<?php echo $v['id']?>">
                                            <?php echo $v['nombre']?>
                                        </option>
                                    <?php endif;?>
                                    <?php endforeach;?>
                                    </select>
                                    <?php //echo $this->Form->select('Laboratoriosrango.rango', array(''=>'Ninguno', '0'=>'Fuera', '1'=>'Dentro'),array('tabindex' => 1)); ?>
                                </div>
                            </div>
             </li>
            <li>
                <div class="form_grid_12">
                    <label class="field_title" for="password">Sexo</label>
                    <div class="form_input">
                         <?php $variable =  array(
                                        
                                            ''=>array(
                                                'id'=>'',
                                        'nombre'=>'Ambos'
                                            ),
                                            '1'=>array(
                                                'id'=>'F',
                                                'nombre'=>'Femenino'
                                            ),
                                            '2'=>array(
                                                'id'=>'M',
                                                'nombre'=>'Masculino'
                                            )
                                            
                                        );

                                    ?>
                        <select name="data[Laboratoriosrango][sexo]">
                                   
                                    <?php foreach($variable as $v):?>
                                    <?php if($this->request->data['Laboratoriosrango']['sexo'] == $v['id']):?>
                                        <option value="<?php echo $v['id']?>" selected="selected">
                                            <?php echo $v['nombre']?>
                                        </option>
                                    <?php else:?>
                                        <option value="<?php echo $v['id']?>">
                                            <?php echo $v['nombre']?>
                                        </option>
                                    <?php endif;?>
                                    <?php endforeach;?>
                                    </select>
                         <?php //echo $this->Form->text('Laboratoriosrango.sexo', array('tabindex' => 1)); ?>
                    </div>
                </div>
             </li>

            <li>
                <div class="form_grid_12">
                    <label class="field_title" for="password">Descripcion </label>
                    <div class="form_input">
                         <?php echo $this->Form->text('Laboratoriosrango.descripcion', array('tabindex' => 1)); ?>
                    </div>
                </div>
             </li>           
            <li>
                <div class="form_grid_12">
                    <div class="form_input">
                        <button type="submit" class="btn_small btn_blue"><span>Guardar cambios</span></button>
                        </div>
                </div>
            </li>
        </ul>
        </form>
    </div>
</div>
